package com.shujia.zookeeper;

import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.ZooDefs;
import org.apache.zookeeper.ZooKeeper;

import java.io.IOException;

public class ZKApi {
    public static void main(String[] args) throws Exception {
        String coon = "master:2181,node1:2181,node2:2181";
        ZooKeeper zk = new ZooKeeper (coon, 3000, null);
        zk.create ("/path", "path".getBytes ( ), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL);
        while (true) {
        }
    }
}
